import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * game模块-游戏记录
 */
@Entity('game_level_record')
export class GameLevelRecordEntity extends BaseEntity {
  @Index()
  @Column({ comment: '关卡id' })
  levelId: number;

  @Index()
  @Column({ comment: '玩家id', default: 0, nullable: true })
  playerId: number;

  @Column({ comment: '得分', nullable: true })
  fraction: number;

  @Column({ comment: '时长', nullable: true })
  duration: number;

  @Column({ comment: '模式 0-单人 1-多人 2-联机', default: 0 })
  mode: number;

  @Column({ comment: '状态 0-已开始 1-游戏过关 2-游戏失败 3-中途退出 4-超时退出', default: 0 })
  status: number;

  @Column({ comment: '备注', nullable: true })
  remark: string;

  @Column({ comment: '第二玩家id', nullable: true })
  secondPlayerId: number;

  @Column({ comment: '房间id', nullable: true })
  roomId: number;
}
